package demo.controller;

import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @date: 2023/2/25 10:22
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @GetMapping("/deduct")
    public boolean deduct(HttpServletRequest request, Integer sum) {
//        try {
//            Thread.sleep(111111111);
//        } catch (InterruptedException e) {
//            throw new RuntimeException(e);
//        }
        String auth = request.getHeader("Auth");
        System.out.println(auth);
        System.out.println("下单了" + sum + "数量");
        return true;
    }

}
